package operatori;

/**
 * @author Sorica Alexandra
 * @date 18.04.2011
 * @version 1.0
 */

public abstract class Cat extends Operator{
	/**
	public double calcul(double aux1, double aux2){
		return aux1 / aux2;     
		}
	public static double Calcul(double aux1, double aux2){
		return aux1 / aux2;
		}
	public double calculeazaValoare(){
		if (ns==null || nd==null)
			System.exit(1);
		return calcul(ns.calculeazaValoare(), nd.calculeazaValoare());
		}
	public double calculDerivata(){
		if (ns==null || nd==null)
			System.exit(1);
		return calcul(ns.calculDerivata(), nd.calculDerivata());
		}
	public String derivare(){
		if (ns==null || nd==null)
			System.exit(1);
		return concatTermeni(ns.derivare(), nd.derivare());
		}
		*/
	public String concatTermeni(String a, String b){
        String aux;
        if(a.compareTo("1") == 0 && b.compareTo("1")==0)
                aux=a;
        else 
                //if(a.compareTo("1")==0)
                        //aux=b;
                //else
                        if(b.compareTo("1")==0)
                                aux=a;
                        else 
                                aux=a + "/" + b;
        return aux;
}

	public static String concatTermens(String a, String b){
        String aux;
        if((a.compareTo("1") == 0 && b.compareTo("1")==0) || a.compareTo("1.0") == 0 || b.compareTo("1.0")==0)
                aux=a;
        else 
                //if(a.compareTo("1")==0)
                //      aux=b;
                //else
                        if(b.compareTo("1")==0)
                                aux=a;
                        else 
                                aux=a + "/" + b;
        return aux;
}

}

